home *** CD-ROM | disk | FTP | other *** search
/ Wonky Flux Batch 2019 02 / Wonky_Flux_Batch_2019-02.zip / Wonky Flux Batch 2019-02 / 106 - Proboard KEY Floppy - Must be in Drive 1.dsk / STAR.TREK.PRO5 / STAR.MAIN.S < prev    next >
Text File  |  1989-08-03  |  7KB  |  221 lines

  1.  
  2. ; Debugged by John P. Edwards
  3.  
  4. ; Tested and Supported on ProBOARD @ 805-239-4292
  5.  
  6. ; Version 1.5
  7.  
  8.  Public damage
  9.  Public dam.ret
  10.  Public end.game
  11.  Public congrats
  12.  Public shoot
  13.  Public phasers
  14.  Public srs.scan
  15.  Public lrs.start
  16.  
  17. Lrs.start
  18.  on nocar goto termin
  19.  if nibble(12)<4 print"Long range sensors are inoperable":link dx$+"star","begin"
  20.  print "Long range scan for quadrant "q2" ,"q1
  21.  o1$="-------------------":print o1$
  22.  for i=(q1-1) to (q1+1):for j=(q2-1) to (q2+1):gosub convert
  23.  next:print":":print o1$:next
  24.  link dx$+"star","commands"
  25.  
  26. Convert
  27.  if (i<1) print ": ***";:return
  28.  if (j>8) print ": ***";:return
  29.  if (i>8) print ": ***";:return
  30.  if (j<1) print ": ***";:return
  31.  i$=str$(byte((i*8-8)+j)+1000):i$=right$(i$,3):print ": "i$;
  32.  s8=((j*3-2)+(i*24-24))
  33.  if s8=1 tr$=i$+right$(tr$,189):return
  34.  if s8>=190 tr$=left$(tr$,189)+i$:return
  35.  if (i<1) or (i>8) or (j<1) or (j>8) print ": +++";:return
  36.  tr$=left$(tr$,s8-1)+i$+right$(tr$,190-s8):return
  37.  
  38. Shoot
  39.  on nocar goto termin
  40.  if (kg<=0) and (fr$="NAV") goto exit.sho:else if kg<=0 linkdx$+"star","begin"
  41.  if d0<>0 print"Starbase shields protect the Enterprise":goto exit.sho
  42.  for i= 1 to kg:if nibble(6+i)<=0 goto shoot2
  43.  f1=nibble(0+i)-s1:if f1<0 f1=s1-nibble(0+i)
  44.  f2=nibble(3+i)-s2:if f2<0 f2=s2-nibble(3+i)
  45.  if f1=0 f1=1
  46.  if f2=0 f2=1
  47.  f1=f1*f2:h=(nibble(6+i)*30)/f1:h=h+random(10):xx$=rnd$
  48.  print h" unit hit on Enterprise from sector "nibble(3+i)","nibble(0+i)
  49.  if s>h goto contin
  50.  if i=kg goto killed:else i=kg:next:goto killed
  51.  
  52. Contin
  53.  s=s-h:if s=0 s=1
  54.  print"       < Shields Down to "s" units >":if h<20 goto shoot2
  55.  r1=random(100):xx$=rnd$:if (r1>60) or ((h*10)/s+1)<1 goto shoot2
  56.  r1=random(8):r1=r1+9:xx$=rnd$
  57.  if h/10>nibble(r1) nibble(r1)=nibble(r1)-nibble(r1):else nibble(r1)=nibble(r1)-h/10
  58.  fr$="SHOOT":linkdx$+"star","sys.dam"
  59.  
  60. Dam.ret
  61.  on nocar goto termin
  62.  if fr$="DAM" goto sys.dam
  63.  print" Damage Control Reports `"n2$" damaged by the hit`  ("h/10" damage)"
  64.  
  65. Shoot2
  66.  next
  67.  
  68. Exit.sho
  69.  pop:if fr$="NAV" linkdx$+"star","nav.shoo":else linkdx$+"star","begin"
  70.  
  71. End.game
  72.  on nocar goto termin
  73.  print" It is stardate "x$:goto results
  74.  
  75. Killed
  76.  print\\"The Enterprise has been destroyed.  The Federation will be conquered.":goto end.game
  77.  
  78. Results
  79.  print"There were "kt" Klingon battle cruisers left at the end of your mission"
  80.  
  81. Res2ults
  82.  print\\:if b9=0 goto termin
  83.  print" The Federation is in need of a new Starship commander for a similar"
  84.  print" mission - - - -   If there is a volunteer let him step forward"
  85.  input" and enter  AYE :";ar$:if ar$="AYE" linkdx$+"star.logon","start"
  86.  
  87. Quit
  88.  link dx$+"star.logon","resign"
  89.  
  90. Termin
  91.  link dx$+"star.logon","termin"
  92.  
  93. Congrats
  94.  on nocar goto termin
  95.  print"Congratulations, Captain!   The last Klingon battle cruiser"
  96.  print"menacing the Federation has been destroyed."
  97.  print\"Entering Your Name in the Hall of Fame..."
  98.  close:open #1,dx$+"star.com":append #1
  99.  ax$=left$(a3$+"....................",20)
  100.  print #1,chr$(32,17)+ax$+"   "+Time$+"  "+Date$
  101.  close:goto res2ults
  102.  
  103. Srs.scan
  104.  on nocar goto termin
  105.  for i=s1-1 to s1+1:for j=s2-1 to s2+1
  106.  if i<1 or i>8 goto srs2.scan
  107.  if j<1 or j>8 goto srs2.scan
  108.  a$=">!<":z1=i:z2=j:gosub cstring:if z3=1 goto srs3.scan
  109.  
  110. Srs2.scan
  111.  next:next
  112.  d0=0:goto srs4.scan
  113.  
  114. Srs3.scan
  115.  if j<s2+1 j=s2+1:next
  116.  if i<s1+1 i=s1+1:next
  117.  d0=100:c$="Docked":e=e0:p=p0
  118.  print "Shields dropped for docking purposes":s=0:goto srs5
  119.  
  120. Srs4.scan
  121.  if kg>0 c$="*RED*":goto srs5
  122.  c$="Green":if e<e0/10 c$="Yellow"
  123.  
  124. Srs5
  125.  if nibble(11)>3 goto srs.print
  126.  print\\"*** SHORT RANGE SENSORS ARE OUT ***"\:link dx$+"star","begin"
  127.  
  128. Srs.print
  129.  x=(clock(2)-clock(1))/60:x$=right$("0"+str$(x),2):x$=str$(tr)+x$
  130.  i$= "   1   2   3   4   5   6   7   8":j=0:i=0  
  131.  i1$="  ---------------------------------":print i$:printi1$:print"1|";
  132.  
  133.  for i=1to8:for j=1to8:print mid$(q$,(j*3-2)+(i*24-24),3)" ";:
  134.  next:goto screen
  135.  
  136. Screen
  137.  if i=1 print"|      Stardate           "x$:print"2|";:next
  138.  if i=2 print"|      Condition          "c$:print"3|";:next
  139.  if i=3 print"|      Quadrant           "q2","q1:print"4|";:next
  140.  if i=4 print"|      Sector             "s2","s1:print"5|";:next
  141.  if i=5 print"|      Photon Torpedoes   "p:print"6|";:next
  142.  if i=6 print"|      Total Energy       "e+s:print"7|";:next
  143.  if i=7 print"|      Shields            "s:print"8|";:next
  144.  if i=8 print"|      Klingons remaining "kt:print i1$
  145.  next:link dx$+"star","commands"
  146.  
  147. Phasers
  148.  on nocar goto termin
  149.  if nibble(13)<4 print "Phasers are inoperative":linkdx$+"star","begin"
  150.  if kg>0 goto phasers2
  151.  print"Science Officer Spock reports:  Sensors show no enemy ships in this quadrant":linkdx$+"star","begin"
  152.  
  153. Phasers2
  154.  if nibble(17)<0 print"Computer failure hampers accuracy"
  155.  print\"Phasers locked on target;  energy available = "e" units"
  156.  
  157. Phasers3
  158.  fr$="PHA":input"Number of energy units to fire ";x
  159.  if x<=0 then link dx$+"star","begin"
  160.  if e-x<0 then goto phasers3
  161.  e=e-x:h1=x/kg
  162.  for i=1to3:if nibble(6+i)<=0 goto pha.end
  163.  f1=nibble(0+i)-s1:if f1<0 f1=s1-nibble(0+i)
  164.  f2=nibble(3+i)-s2:if f2<0 f2=s2-nibble(3+i)
  165.  if f1=0 f1=1
  166.  if f2=0 f2=1
  167.  f1=f1*f2:j=h1/f1:h=j/5
  168.  if h>byte(6+i)/10 goto pha4
  169.  print "Sensors show no damage to enemy at ";
  170.  print nibble(3+i)","nibble(0+i):goto pha.end
  171.  
  172. Pha4
  173.  x=nibble(6+i):x=x-h:nibble(6+i)=x
  174.  print h*10" unit hit on Klingon at sector "nibble(3+i)","nibble(0+i)
  175.  if x<=0 print"**** Klingon destroyed ****":goto pha5
  176.  print\" Sensors show "nibble(6+i)*10" units remaining for Klingon";
  177.  if i print " at "nibble(3+i)","nibble(0+i):else print
  178.  goto pha.end
  179.  
  180. Pha5
  181.  kg=kg-1:kt=kt-1:z1=nibble(0+i):z2=nibble(3+i):a$="   ":gosub astring
  182.  nibble(6+i)=0:byte((8*q1-8)+q2)=byte((8*q1-8)+q2)-100
  183.  in=((8*q1-8)+q2):a$=right$(str$(byte(in)+1000),3)
  184.  s8=(q2*3-2)+(q1*24-24)
  185.  if s8=1 tr$=a$+right$(tr$,189):goto pha5
  186.  if s8>=190 tr$=left$(tr$,189)+a$:goto pha5
  187.  tr$=left$(tr$,s8-1)+a$+right$(tr$,190-s8)
  188.  
  189. Pha5
  190.  if kt<=0 goto congrats
  191.  
  192. Pha.end
  193.  next:gosub shoot
  194.  
  195. Astring
  196.  s8=(z2*3-2)+(z1*24-24)
  197.  if s8=1 q$=a$+right$(q$,189):return
  198.  if s8>=190 q$=left$(q$,189)+a$:return
  199.  q$=left$(q$,s8-1)+a$+right$(q$,190-s8):return
  200.  
  201. Cstring
  202.  s8=((z2*3-2)+(z1*24-24)):z3=0
  203.  if mid$(q$,s8,3)<>a$ return
  204.  z3=1:return
  205.  
  206. Damage
  207.  on nocar goto termin
  208.  if nibble(15)<2 print"Damage Control too damaged to respond"\:goto dam.end
  209.  print "   Device              State of Repair"
  210.  for r1= 10 to 17:if nibble(r1)<0 nibble(r1)=0:if nibble(r1)>10 nibble(r1)=10
  211.  fr$="DAM":link dx$+"star","sys.dam"
  212.  
  213. Sys.dam
  214.  x=30-len(n2$):print"  "n2$;chr$(32,x);nibble(r1)*10" %":next
  215.  
  216. Dam.end
  217.  link dx$+"star","begin"
  218.  
  219. ; EOF
  220.  
  221.